/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.rbh.risk.service.impl;

import com.rbh.risk.dao.SubEventDao;
import com.rbh.risk.entity.MainEvent;
import com.rbh.risk.entity.SubEvent;
import com.rbh.risk.service.SubEventService;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service("subEventService")
public class SubEventServiceImpl implements SubEventService {

    @Autowired
    private SubEventDao subEventDao;

    @Transactional(readOnly = false)
    @Override
    public void insert(SubEvent subEvent) {
        this.subEventDao.insert(subEvent);
    }

    @Transactional(readOnly = false)
    @Override
    public void update(SubEvent subEvent) {
        this.subEventDao.update(subEvent);
    }

    @Transactional(readOnly = false)
    @Override
    public void delete(SubEvent subEvent) {
        this.subEventDao.delete(subEvent);
    }

    @Transactional(readOnly = true)
    @Override
    public SubEvent getById(Integer subEventId) {
        return this.subEventDao.getById(subEventId);
    }

    @Transactional(readOnly = true)
    @Override
    public List<SubEvent> getAll() {
        return this.subEventDao.getAll();
    }

    @Transactional(readOnly = true)
    @Override
    public List<SubEvent> getByWords(String words) {
        return this.subEventDao.getByWords(words);
    }

    @Transactional(readOnly = true)
    @Override
    public List<SubEvent> getByMainEvent(MainEvent mainEvent) {
        return this.subEventDao.getByMainEvent(mainEvent);
    }
}
